package top.sdwu_top.kbase.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.multipart.MultipartFile;
import top.sdwu_top.kbase.dto.KbaseFileDto;
import top.sdwu_top.kbase.entity.KbaseAuthUser;
import top.sdwu_top.kbase.entity.KbaseFile;
import com.baomidou.mybatisplus.extension.service.IService;
import top.sdwu_top.kbase.entity.KbaseFileVersion;
import top.sdwu_top.kbase.entity.KbaseFileVersionApply;
import top.sdwu_top.kbase.vo.KbaseFileVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 文件表 服务类
 * </p>
 *
 * @author zhipeng.duan@nvr-china.com
 * @since 2020-02-20
 */
public interface IKbaseFileService extends IService<KbaseFile> {

    KbaseFile upload(KbaseAuthUser user, MultipartFile file, String fileName, String visibleType, String tagList);

    KbaseFileVersionApply updateFile(KbaseAuthUser user, String fileId, MultipartFile file, String content);

    void download(HttpServletRequest request, HttpServletResponse response, String id, Integer version, String applyId);

    KbaseFileDto getFileInfo(String fileId, Integer version);

    Page<KbaseFile> page(KbaseAuthUser user, KbaseFileVo vo);

    boolean isCreator(KbaseAuthUser user, String fileId);

    Page<KbaseFile> currentUserPage(KbaseAuthUser user, Long current, Long size);

    List<KbaseFile> list(KbaseAuthUser user, String keyword);


}
